/*
 * @Author: LeeZB
 * @Date: 2025-07-05 09:11:30
 * @LastEditors: Leezb101 leezb101@126.com
 * @LastEditTime: 2025-07-05 09:16:50
 * @copyright: Copyright © 2025 高新供水.
 */
import { alovaInstance } from "..";

class AuthAPI {
  static getCodeImg() {
    return alovaInstance.Get("/spo/auth/login/getCodeImg", {
      meta: {
        needHeaders: true,
      },
      transform: (data: unknown) => {
        const nd = data as { data: string; headers: Record<string, string> };
        const prefix = "data:image/png;base64,";
        return {
          headers: nd.headers,
          data: prefix + nd.data,
        };
      },
    });
  }
    static login(params: {}) {
    return alovaInstance.Post("/spo/auth/login/unite/password", {
      data: params,
    });
  }
}

export default AuthAPI;
